<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/10/22
 * Time: 13:40
 */

namespace app\common\service;


use think\Db;

class ServerLoginLog
{
    /**
     * @name 查询
     * @param $condition
     * @return array|null|\PDOStatement|string|\think\Model
     * @author wx
     * @date 2019/10/21 16:45
     */
    public function findData($condition)
    {
        return Db::name('server_login_log')->where($condition)->find();
    }

    /**
     * @name 查询符合条件的条数
     * @param $condition
     * @return float|string
     * @author wx
     * @date 2019/10/22 13:42
     */
    public function findCount($condition)
    {
        return Db::name('server_login_log')->where($condition)->count();
    }

    /**
     * @name 添加
     * @param $data
     * @return int|string
     * @author wx
     * @date 2019/11/27 13:20
     */
    public function add($data)
    {
        return Db::name('server_login_log')->insert($data);
    }

    /**
     * @name 删除
     * @param $condition
     * @return int
     * @author wx
     * @date 2019/11/27 13:20
     */
    public function del($condition)
    {
        return Db::name('server_login_log')->where($condition)->delete();
    }
}